home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / bipl.zip / PROCS.ZIP / ASCIINAM.ICN < prev    next >
Text File  |  1992-12-30  |  802b  |  29 lines

  1. ############################################################################
  2. #
  3. #    File:     asciiname (asciinam.icn)
  4. #
  5. #    Subject:  Procedure for ASCII name of unprintable character
  6. #
  7. #    Author:   Robert J. Alexander
  8. #
  9. #    Date:     September 7, 1990
  10. #
  11. ###########################################################################
  12. #
  13. #  asciiname -- Procedure to return mnemonic name of ascii non-printable
  14. #  characters.
  15. #
  16.  
  17. procedure asciiname(s)
  18.    local o
  19.    static names
  20.    initial {
  21.       names := ["NUL","SOH","STX","ETX","EOT","ENQ","ACK","BEL",
  22.         "BS" ,"HT" ,"NL" ,"VT" ,"NP" ,"CR" ,"SO" ,"SI" ,
  23.         "DLE","DC1","DC2","DC3","DC4","NAK","SYN","ETB",
  24.         "CAN","EM" ,"SUB","ESC","FS" ,"GS" ,"RS" ,"US" ]
  25.       }
  26.    o := ord(s)
  27.    return names[o + 1] | (if o = 127 then "DEL")
  28. end
  29.